package cn.com.Kol.ITPMP.TenMajorAreas.model;

import cn.com.Kol.ITPMP.System.Area;
import cn.com.Kol.ITPMP.System.Process;

import static cn.com.Kol.ITPMP.System.Constants.*;

public class CostManagement extends Area {

    private Process MakeCostManagementPlan = new Process(MAKE_COST_MANAGEMENT_PLAN);
    private Process CostEstimate = new Process(COST_ESTIMATE);
    private Process CostBudget = new Process(COST_BUDGET);
    private Process CostControl = new Process(COST_CONTROL);

    private void CostManagementProcess(){
        CreateProcess(MakeCostManagementPlan);
        CreateProcess(CostEstimate);
        CreateProcess(CostBudget);
        CreateProcess(CostControl);
    }

    public void SetInputs(Process process){
        switch (process.getProcessName()){
            case "规划成本管理":
                process.inputs(PROJECT_MANAGEMENT_PLAN);
                process.inputs(PROJECT_CHARTER);
                process.inputs(ENTERPRISE_ENVIRONMENTAL_FACTORS);
                process.inputs(ORGANIZATIONAL_PROCESS_ASSETS);
                break;
            case "成本估算":
                process.inputs(COST_MANAGEMENT_PLAN);
                process.inputs(HUMAN_RESOURCE_MANAGEMENT_PLAN);
                process.inputs(SCOPE_BASELINE);
                process.inputs(PROJECT_SCHEDULE);
                process.inputs(RISK_REGISTER);
                process.inputs(ENTERPRISE_ENVIRONMENTAL_FACTORS);
                process.inputs(ORGANIZATIONAL_PROCESS_ASSETS);
            case "成本预算":
                process.inputs(COST_MANAGEMENT_PLAN);
                process.inputs(SCOPE_BASELINE);
                process.inputs(ACTIVITY_COST_ESTIMATE);
                process.inputs(ESTIMATE_GIST);
                process.inputs(PROJECT_SCHEDULE);
                process.inputs(RESOURCE_CALENDAR);
                process.inputs(RISK_REGISTER);
                process.inputs(PROTOCOL);
                process.inputs(ORGANIZATIONAL_PROCESS_ASSETS);
            case "成本控制":
                process.inputs(PROJECT_MANAGEMENT_PLAN);
                process.inputs(PROJECT_CAPITAL_REQUIREMENTS);
                process.inputs(WORK_PERFORMANCE_DATA);
                process.inputs(ORGANIZATIONAL_PROCESS_ASSETS);
        }
    }

    public void UseToolAndTech(Process process){
        switch (process.getProcessName()){
            case "规划成本管理":
                process.useToolAndTech(EXPERT_JUDGEMENT);
                process.useToolAndTech(ANALYSIS_TECHNICS);
                process.useToolAndTech(CONFERENCE);
                break;
            case "成本估算":
                process.useToolAndTech(EXPERT_JUDGEMENT);
                process.useToolAndTech(ANALOGY_ESTIMATE);
                process.useToolAndTech(PARAMETER_ESTIMATE);
                process.useToolAndTech(BOTTOM_UP_ESTIMATE);
                process.useToolAndTech(THREE_POINT_ESTIMATE);
                process.useToolAndTech(RESERVE_ANALYSIS);
                process.useToolAndTech(QUALITY_COSTS);
                process.useToolAndTech(PROJECT_MANAGEMENT_SOFTWARE);
                process.useToolAndTech(VENDOR_BID_ANALYSIS);
                process.useToolAndTech(GROUP_DECISION_MAKING_TECHNIQUE);
            case "成本预算":
                process.useToolAndTech(COST_SUMMARY);
                process.useToolAndTech(RESERVE_ANALYSIS);
                process.useToolAndTech(EXPERT_JUDGEMENT);
                process.useToolAndTech(HISTORICAL_RELATION);
                process.useToolAndTech(FUNDING_LIMIT_RECONCILIATION);
            case "成本控制":
                process.useToolAndTech(EARNED_VALUE_MANAGEMENT);
                process.useToolAndTech(PREDICTION);
                process.useToolAndTech(TO_COMPLETE_PERFORMANCE_INDEX);
                process.useToolAndTech(PERFORMANCE_REVIEWS);
                process.useToolAndTech(PROJECT_MANAGEMENT_SOFTWARE);
                process.useToolAndTech(RESERVE_ANALYSIS);
        }
    }

    public void SetOutputs(Process process){
        switch (process.getProcessName()){
            case "规划成本管理":
                process.outputs(COST_MANAGEMENT_PLAN);
                break;
            case "成本估算":
                process.outputs(ACTIVITY_COST_ESTIMATE);
                process.outputs(ESTIMATE_GIST);
                process.outputs(PROJECT_FILE_UPDATE);
            case "成本预算":
                process.outputs(COST_BASELINE);
                process.outputs(PROJECT_CAPITAL_REQUIREMENTS);
                process.outputs(PROJECT_FILE_UPDATE);
            case "成本控制":
                process.outputs(WORK_PERFORMANCE_INFO);
                process.outputs(COST_PREDICTION);
                process.outputs(CHANGE_REQUESTS);
                process.outputs(PROJECT_MANAGEMENT_PLAN_UPDATE);
                process.outputs(PROJECT_FILE_UPDATE);
                process.outputs(ORGANIZATIONAL_PROCESS_ASSETS_UPDATE);
        }

    }

}
